package com.cqw.commontest.data;

import java.text.DecimalFormat;

/**
 * @Author: caoqingwen
 * @CreateTime: 2021-05-25 11:16
 * @Description:
 */
public class DataTest {


    public static void main(String[] args) {
        double a = 1.126;
        double v = a / 2;
        System.out.println(v);
        long round = Math.round(a);
        System.out.println(round);


        long i = 5L;
        long l = i / 2;
        System.out.println(l);

        //保留2位小数
        DecimalFormat decimalFormat = new DecimalFormat("0.00");
        String format = decimalFormat.format(a);
        System.out.println(format);


    }


}
